<layout name="../Common/Master/master"/>
<include file="../Common/Master/left"/>
<script src="__PUBLIC__/Home/laydate/laydate.js"></script>
<script src="__PUBLIC__/Home/js/area.js"></script>
<style>
    .orderright h2{
      font-size: 20px;
        color: black;
        font-weight: normal;
    }
    #btn{
        padding: 5px;background: orange;color: #fff;border:none;cursor: pointer
    }
    #btn:hover{
        background: deepskyblue;
    }
</style>
<div class="orderright">
   <h2>申请退货</h2>
   <div style="margin-top: 20px">
       <a href="{:U('home/goodinfo/index',['gid'=>$good['gid']])}" style="display: inline-block;height: 80px;float: left"><img width="80px" height="80px" src="{$good['thumb']}" alt=""></a>
       <a href="{:U('home/goodinfo/index',['gid'=>$good['gid']])}" style="display: inline-block;width: 300px;height: 80px;overflow: hidden;margin-left:30px;float: left">{$good['gname']}</a>
       <span style="display: inline-block;height: 80px;line-height: 80px;margin-left: 20px">数量：{$good['count']}</span>
       <span style="display: inline-block;height: 80px;line-height: 80px;margin-left: 20px">单价：￥{$good['priced']}</span>
       <span style="display: inline-block;height: 80px;line-height: 80px;margin-left: 20px">小计：￥{$good['count']*$good['priced']}</span>
   </div>

    <form action="" method="post" onsubmit="return confire()">
        <div style="margin-top: 20px">
            <p style="margin-bottom: 10px">请填写退货理由</p>
            <textarea name="reason" id="" cols="50" rows="5" placeholder="请认真填写退货理由"></textarea>
            <div style="margin-top:10px ">
                <button id="btn"  type="submit">提交</button>
            </div>
        </div>
    </form>
</div>
<script>
    function confire(){
        var data=$('form').serialize();
          ugid="{:I('get.ugid')}";
          data=data+'&ugid='+ugid;
//        alert(data);return;
         $.post("{:U('home/userinfo/refund')}",data,function(res){
           if(res.valid){
               layer.alert(res.msg, {icon: 6,yes:function(){
                   location.href="{:U('home/userinfo/rengood')}";
               }});
           }else{
               layer.alert(res.msg, {icon: 6});
           }
        });
        return false;
    }
</script>




